﻿@using CoreData
@using Helper
@model Product
@{
    ViewBag.Title = Model.Name;
}
@section HeadResource{
    <title>@ViewBag.Title</title>
    <link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/css/product.css")">
    <link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/plugins/kyersTab/css/kyersTab.css")">
}
@section BottomResource{
    <script type="text/javascript" src="@Url.Content("~/Content/plugins/elevatezoom-master/jquery.elevatezoom.js")"></script>
	<script type="text/javascript" src="@Url.Content("~/Content/plugins/kyersTab/js/kyersTab.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Content/js/product.js")"></script>
}
@section MainBanner{
    @if (Model != null)
    {
        <div id="mainSlideshow" class="belloSlideShow">
            <div class="slide-block-image">
                <ul>
                    <li style="background-image: url(/Media/Product/@Model.Image);"></li>
                </ul>
            </div>
        </div>
    }
}
@if (Model != null)
{
    <div class="product-grid grid-view">
        <div class="product-title">
            <h1>
                @Model.Name</h1>
        </div>
        <div class="left-attr-product">
            <div class="bello-zoom-box" id="belloZoomBox">
                <div class="zoom-nav">
                    <div class="z-nav-inner">
                        <ul>
                            <li>
                                <div class="zoom-nav-item">
                                    <a href="@Url.Content("~/Media/Product/" + @Model.Image + "")" target="_blank">
                                        <img src="/Media/Product/@Model.Image" alt="@Model.Image" /></a></div>
                            </li>
                            @if (Model.ProductAttributeExt != null)
                            {
                                foreach (var item in Model.ProductAttributeExt.Where(x => x.AttributeNameExt.Contains("Hình ảnh")))
                                { 
                                <li>
                                    <div class="zoom-nav-item">
                                        <a href="@Url.Content("~/Media/ProductAttribute/" + item.Value)" target="_blank">
                                            <img src="@Url.Content("~/Media/ProductAttribute/" + item.Value)" alt="@item.Value" /></a></div>
                                </li>
                                }
                            }
                        </ul>
                    </div>
                </div>
                <div class="zoom-images-box">
                    <div class="zoom-wrap">
                        <a href="@Url.Content("~/Media/Product/" + @Model.Image + "")" target="_blank">
                            <img id="imgZoomMain" src="/Media/Product/@Model.Image" alt="@Model.Image" />
                        </a>
                    </div>
                </div>
            </div>
        </div>
        <div class="product-view">
            <div class="content-product">
                <div class="product-head">
                    <span class="code-inf"><span class="viewer">Lượt xem:
                        <label>
                            @Model.View</label></span> <span class="date-post">Ngày đăng:
                                <label>
                                    @Model.CreateDate.ToString("dd/MM/yyyy")</label></span> </span>
                </div>
                <div class="product-detail">
                    <div class="product-sprice">
                        <ul>
                            <li class="shop-sprice">
                                <label>
                                    Giá:
                                </label>
                                <span>@StringHelper.FormatVND(int.Parse(Model.Price.ToString()))</span></li>
                            <li>
                                <label>
                                    Xuất sứ:
                                </label>
                                <span>Đà Lạt</span></li>
                            <li>
                                <label>
                                    Hạn dùng:
                                </label>
                                <span>@Model.Shelf</span></li>
                            <li>
                                <label>
                                    Bảo quản:
                                </label>
                                <span>Lạnh</span></li>
                        </ul>
                    </div>
                    <div class="product-detail-infor">
                        <div class="product-status">
                            <label>
                                Trạng thái:
                            </label>
                            <span>Còn hàng</span></div>
                        <p>
                            @Model.ShortDescription
                        </p>
                    </div>
                    <div class="product-add-box">
                        <div class="quantity">
                            <div class="count-total">
                                <label>
                                    Số lượng</label>
                                <input type="text" class="txt" value="1" />
                            </div>
                            <span class="total-sprice">
                                <label>
                                    Tổng tiền:
                                </label>
                                <span>@StringHelper.FormatVND(int.Parse(Model.Price.ToString()))</span></span>
                        </div>
                        <div class="add-to-box">
                            <a href="@Url.Action("BuyNow", "ShoppingCart", new { ProductId = Model.ID, Amount = 1 })" class="btn gray btn-pay">Mua ngay</a>
                            <input type="button" class="btn btn-add-cart" ProductId="@Model.ID" Amount="1" value="Thêm vào giỏ">
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="clearfix">
        </div>
        <div class="tab-detail-content">
            <ul class="tab-head">
                <li><a href="#">Thông tin chi tiết</a></li>
                <li><a href="#">Đánh giá</a></li>
            </ul>
            <ul class="tab-content">
                <li class="tab-item">
                    <div class="tab-inner">
                        @Html.Raw(Model.FullDescription)
                    </div>
                </li>
                <li class="tab-item">
                    <div class="tab-inner">
                        <p>
                            Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce vel est consectetur,
                            scelerisque erat nec, accumsan lacus. Proin in mauris justo. Nullam dignissim sit
                            amet nulla ac suscipit. In dignissim ante sem, at cursus ligula pulvinar nec. Maecenas
                            libero libero, vulputate eu vehicula nec, porttitor sit amet tortor. Etiam fermentum,
                            sapien ac tempus feugiat, tellus enim fringilla dui, at mollis urna quam a nunc.
                            Quisque at tincidunt ipsum, eget iaculis magna.</p>
                    </div>
                </li>
            </ul>
        </div>
    </div>
    
    @Html.Action("_RelatedProduct", "Product", new { Id = Model.CateID })
}
